package cn.mesmile.design.strategy;

/**
 * @author zb
 * @version 1.0
 * @date 2020/11/21 13:54
 * @description
 */
public class Main {

    public static void main(String[] args) {
        ProductOrder productOrder = new ProductOrder(100.1, 1, 10);
        double finalPrice;
        PromotionContext promotionContext;

        promotionContext = new PromotionContext(new NormalActivity());
        finalPrice = promotionContext.executeStrategy(productOrder);
        System.out.println(">>>>>>>> 普通价格:"+ finalPrice);


        promotionContext = new PromotionContext(new DiscountActivity(0.8));
        finalPrice = promotionContext.executeStrategy(productOrder);
        System.out.println(">>>>>>>>>>> 打折价格："+ finalPrice);


    }
}
